package com.qiuyang.service;

import com.qiuyang.mapper.TypeMapper;
import com.qiuyang.pojo.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
public class TypeServiceImpl implements TypeService {


    @Autowired
    private TypeMapper typeMapper;

    /*-----------------------------------------------------------------------*/

    @Override
    public void insertType(Type type) {
        typeMapper.insertType(type);
    }

    @Override
    public void deleteTypes(Long id) {
        typeMapper.deleteTypes(id);
    }

    @Override
    public void updateTypes(Type type) {
        typeMapper.updateTypes(type);
    }

    @Override
    public Type findTypeByName(String name) {
        return typeMapper.findTypeByName(name);
    }

    @Override
    public Type findTypeById(Long id) {
        return typeMapper.findTypeById(id);
    }

    @Override
    public List<Type> getAllType() {
        return typeMapper.getAllType();
    }


}
